﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;


namespace BookStore.Data
{
   public class Contactcontroller
    {
        static SqlConnection con = sqlDataProvider.getConnect();
        //static DataTable dt;
       public static bool InsertContact(Contactinfo contact) 
       {
           bool flag = true;
           using (SqlCommand cmd = new SqlCommand("InsertContactus",con))
           {
               cmd.CommandType = CommandType.StoredProcedure;
               cmd.Parameters.Add(new SqlParameter("@name",contact.Name));
               cmd.Parameters.Add(new SqlParameter("@email", contact.Email));
               cmd.Parameters.Add(new SqlParameter("@content", contact.Content));
               int i = cmd.ExecuteNonQuery();
               if (i>0)
               {
                   return true;
               }
               return flag;
           }
       }
    }
}
